<?php
$from = $_GET['from']?urldecode(trim($_GET['from'])):'';
$tid = $_GET['tid']?urldecode(trim($_GET['tid'])):'';
$date = $_GET['date']?trim($_GET['date']):'';
$refresh = $_GET['refresh']?trim($_GET['refresh']):'60';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="zh-CN">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>火车票刷票器 - Made by icyleaf.</title>
<link rel="stylesheet" href="layout.css" type="text/css" media="screen" title="no title" charset="utf-8" />
<script type="text/javascript" src="http://www.google.com/jsapi"></script>
<script type="text/javascript">
 google.load("jquery", "1");
</script>
<script type="text/javascript">
<!--	
function refresh() {
	if (document.getElementById('paused_state').value == "false") {
		parent.browser.location = "grubTicket.php<?php echo '?from='.$from.'&tid='.$tid.'&date='.$date; ?>";
	}
	setTimeout("refresh()", <?php echo ($refresh * 1000); ?>);
}

function pause() {
	$("p.message").slideToggle("slow");
	if (document.getElementById('PauseButton').text == "暂停") {
		$("#PauseButton").text("开始");
		document.getElementById('paused_state').value = "true";
	} else {
		$("#PauseButton").text("暂停");
		document.getElementById('paused_state').value = "false";
	}
}
//-->
</script>
</head>
<body onLoad="refresh();">
<form action="" method="post">
	<input type="hidden" id="paused_state" name="paused_state" value="false" />
</form>

<nobr>
	<div id="BarArea">
		<div id="BarRunning">
			<div id="Bar">
				<div id="BarHeader">
					<h1>火车票刷票器</h1>
				</div>
				<div id="BarContent">
					<p class="message" style="display:none">页面暂停刷新</p>
					<p class="message">
						页面每隔<span id="refresh"><strong><?php echo $refresh; ?></strong></span> 秒刷新
					</p> 
					<div id="BarButtons">
						<p>
							<a href="javascript:void(0);" onClick="pause();" id="PauseButton">暂停</a>
						</p> 
					</div>
				</div>
			</div>
		</div>
	</div>
</nobr>
</body>
</html>

